package com.labreeze.spring.util;

import java.util.StringTokenizer;
import java.util.Vector;

public class StringUtils {
	
	public static void main(String[] args) {
		
		split("*.jpg;*.gif;*.swf;*.js;*.tld;check.html", ";");
		
	}
	
	
	public static String[] split(String str, String x)
	  {
	    if (str == null) {
	      return null;
	    }
	    if (x == null) {
	      return null;
	    }
	    Vector v = new Vector();
	    StringTokenizer stToken = new StringTokenizer(str, x);
	    int iIndex = 0;
	    while (stToken.hasMoreTokens()) {
	      String strToken = stToken.nextToken();
	      System.out.println(iIndex+","+strToken);
	      v.add(iIndex++, strToken);
	    }
	    String[] seqResult = new String[v.size()];
	    for (int i = 0; i < v.size(); i++) {
	      String strTemp = (String)v.get(i);
	      seqResult[i] = strTemp;
	    }
	    return seqResult;
	  }

}
